package com.ricky.onlineShop.shop.trading.service.impl;

import com.ricky.base.repository.BaseRepository;
import com.ricky.onlineShop.shop.trading.pojo.TradingFile;
import com.ricky.onlineShop.shop.trading.repository.TradingFileRepository;
import com.ricky.onlineShop.shop.trading.service.ITradingFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author staticlan
 * @Date 2024/6/20 15:42
 * @Description:
 */
@Service
@Slf4j
public class TradingFileServiceImpl implements ITradingFileService {
    @Autowired
    private TradingFileRepository tradingFileRepository;

    @Override
    public BaseRepository<TradingFile, String> getRepository() {
        return tradingFileRepository;
    }


    @Override
    public List<TradingFile> findByMainId(String mainId) {
        return tradingFileRepository.findByMainId(mainId);
    }

    @Override
    public void deleteAllByMainId(String mainId) {
        tradingFileRepository.deleteAllByMainId(mainId);
    }
}
